<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ page import="user.vo.User" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<script type="text/javascript" language="JavaScript">
	function confirmPwd() {
		var form = document.getElementById('formid');
		var pwd = document.getElementById("pwd").value;
		var newpwd = document.getElementById("newpwd").value;
		var confirm = document.getElementById("confirm").value;
		var userpwd = ${sessionScope.user.pwd};
		if(pwd != userpwd){
			alert("密码输入错误，请重新输入");
			form.reset();
			return;
		}
		if (newpwd == "") {
			alert('新密码不能为空');
			return;
		}
		if (confirm == "") {
			alert('确认密码不能为空');
			return;
		}
		if(newpwd != confirm){
			alert('2次输入密码不一致');
			form.reset();
			return;
		}
		form.submit();
	}
</script>
<body>
	<form action="loginSer?ope=changePwds" method="post" id="formid">
			<input type="hidden" name="loginName">
		原密码:<input type="password" name="oldpwd" id="pwd"></br> 新密码:<input
			type="password" name="newpwd" id="newpwd"></br> 新密码确认:<input
			type="password" name="confirm" id="confirm"></br> <input
			type="button" value="修改" onclick="javascript:confirmPwd()"><input
			type="reset">
	</form>
</body>
</html>